package com.jwdf.uda.ui.fragment.user.personal;

import android.os.Bundle;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.event.FilterListEvent;
import com.jwdf.uda.ui.fragment.find.UserInfoSquareFragment;
import com.jwdf.uda.utils.ConfigUtils;

/**
 * Created by Administrator on 2016/6/20.
 */
public class ExtendSquareFragment extends UserInfoSquareFragment {

    public static ExtendSquareFragment instance(String userId) {
        ExtendSquareFragment view = new ExtendSquareFragment();
        Bundle args = new Bundle();
        args.putString("uid", userId);
        view.setArguments(args);
        return view;
    }

    @Override
    protected String getUserId() {
        return getArguments().getString("uid").equals(ConfigUtils.getUserId(getContext())) ? "" : getArguments().getString("uid");
    }

    @Override
    public void onEvent(FilterListEvent event) {
        autoRefresh();
    }

    @Override
    protected PbBean.PbSignPageFilterType getFilterType() {
        return getArguments().getString("uid").equals(ConfigUtils.getUserId(getContext())) ? PbBean.PbSignPageFilterType.PAGE_FILTER_TYPE_SELF : PbBean.PbSignPageFilterType.PAGE_FILTER_TYPE_USER;
    }
}
